package com.yongjie.springbootlogin.service;

import com.yongjie.springbootlogin.entity.DoctorInfo;
import com.yongjie.springbootlogin.mapper.DoctorInfoMapper;
import com.yongjie.springbootlogin.mapper.Impl.DoctorInfMapperImpl;
import com.yongjie.springbootlogin.service.Interface.IDoctorInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 医生信息
 * @author 13468
 */
@Service
public class DoctorInfoServiceImpl implements IDoctorInfoService {
    @Autowired
     DoctorInfoMapper doctorInfoMapper=new DoctorInfMapperImpl();
    /**
     * 查询全部医生信息
     * @return
     */
    @Override
    public List<DoctorInfo> selectAll() {
        List<DoctorInfo> list = doctorInfoMapper.selectAll();
        return list;
    }
    /**
     * 搜索查询
     * @return
     */
    @Override
    public List<DoctorInfo> checkSelct(String dname, String phone) {
        List<DoctorInfo> list = doctorInfoMapper.checkSelct(dname ,phone);
        return list;
    }



    /**
     * 查询单条数据
     */
    @Override
    public DoctorInfo lookInfo(String id) {
        return doctorInfoMapper.lookInfo(id);
    }

    /**
     * 添加医生
     * @param doctorInfo
     * @return
     */
    @Override
    public int addDoctor(DoctorInfo doctorInfo) {
        return doctorInfoMapper.addDoctor(doctorInfo) ;
    }

    /**
     * 删除医生
     * @param id
     * @return
     */
    @Override
    public int deleteDoctor(String id) {
        return doctorInfoMapper.deleteDoctor(id);
    }

    /**
     * 删除医生账号
     * @param id
     * @return
     */
    @Override
    public int deleteUser(String id) {
        return doctorInfoMapper.deleteUser(id);
    }

}
